<!DOCTYPE html>
<html style="min-height: 883px;"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <meta charset="UTF-8">
        <title>AdminLTE | factory management</title>
        <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
        <!-- bootstrap 3.0.2 -->
        <link href="AdminLTE%20_%20factory%20management%281%29_files/bootstrap.css" rel="stylesheet" type="text/css">
        <!-- font Awesome -->
        <link href="AdminLTE%20_%20factory%20management%281%29_files/font-awesome.css" rel="stylesheet" type="text/css">
        <!-- Ionicons -->
        <link href="AdminLTE%20_%20factory%20management%281%29_files/ionicons.css" rel="stylesheet" type="text/css">
        <!-- fullCalendar -->
        <link href="AdminLTE%20_%20factory%20management%281%29_files/fullcalendar_002.css" rel="stylesheet" type="text/css">
        <link href="AdminLTE%20_%20factory%20management%281%29_files/fullcalendar.css" rel="stylesheet" type="text/css" media="print">
        <!-- Theme style -->
        <link href="AdminLTE%20_%20factory%20management%281%29_files/AdminLTE.css" rel="stylesheet" type="text/css">

    	<style type="text/css">
    		.star{
    			color: red;
    		}
    		.special{
    			border: 1px solid black;
    		}
    		.style label{
    			width: 15%;
    		} 
    		/*新增样式*/
			ol{
				list-style: none;
			}
    		.ol_left{
	            width: 100%;
	            height: 30px;
	            line-height: 30px;
	            padding: 0;
	        }
	        .ol_left>li{
	            float: left;
	            margin-right: 5px;
	        }
	        .ol_left li, .ol_left{
	        	margin-bottom: 0;
	        }
    	</style>
    </head>
    <body class="skin-blue  pace-done" style="min-height: 883px;"><div class="pace  pace-inactive"><div class="pace-progress" style="width: 100%;" data-progress-text="100%" data-progress="99">
  <div class="pace-progress-inner"></div>
</div>
<div class="pace-activity"></div></div>
        <!-- header logo: style can be found in header.less -->
        <!-- header logo: style can be found in header.less -->
<header class="header">
	<a href="http://139.224.191.23/index.html" class="logo"> <img src="AdminLTE%20_%20factory%20management%281%29_files/logo_03.jpg"> 后台管理系统
	</a>
	<!-- Header Navbar: style can be found in header.less -->
	<nav class="navbar navbar-static-top" role="navigation">
		<div class="navbar-right">
			<ul class="nav navbar-nav">
				<!-- Notifications: style can be found in dropdown.less -->
				<li class="dropdown notifications-menu" style="margin: 0;"><a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="iconfont"></i> 设置
				</a></li>
				<!-- User Account: style can be found in dropdown.less -->
				<li class="dropdown user user-menu" style="margin: 0;"><a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="glyphicon glyphicon-user"></i> <span><span id="name2">3dfsafttttt</span> <i class="caret"></i></span>
				</a>
					<ul class="dropdown-menu" style="padding: 0">

						<!-- User image -->
						<li class="user-header bg-light-blue">
							<ul class="pull-left" style="border: none;">
								<li id="email">账号：admin</li>
								<li id="name">姓名：3dfsafttttt</li>
								<li id="roleName">角色：设计总监</li>
							</ul>
						</li>
						<!-- Menu Footer-->
						<li class="user-footer">
							<div class="pull-left" style="border: none;">
								<a href="#" class="btn btn-default btn-flat change_btn" data-toggle="modal" data-target="#myModal0">修改密码</a>
							</div>
							<div class="pull-right">
								<a id="exit" href="#" class="btn btn-default btn-flat">退出</a>
							</div>
						</li>
					</ul></li>
			</ul>
		</div>
	</nav>
</header>



<!--修改密码弹框-->
<div class="modal fade" id="myModal0" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div id="modal-dialog" class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h4 class="modal-title" id="myModalLabel">修改密码</h4>
			</div>
			<div class="modal-body">
				<div class="change_pw" style="display: none;">
				<form id="passwordform" action="">
					<div class="old_pw">
						<div class="input-group input-password">
							<span class="input-group-addon new_add">原密码</span> <input id="oldPassword" name="oldPassword" class="form-control" placeholder="请输入原密码" type="password">
						</div>
					</div>
					<div class="new_pw">
						<div class="input-group input-password">
							<span class="input-group-addon">设置新密码</span> <input id="newPassword1" name="newPassword" class="form-control" placeholder="请输入新密码" type="password">
						</div>
						<div>密码由6~8位字母（字母区分大小写）和数字组成</div>
					</div>
					<div class="beSure_pw">
						<div class="input-group input-password">
							<span class="input-group-addon">确认新密码</span> <input id="newPassword2" class="form-control" placeholder="请输入密码" type="password">
						</div>
						<div id="notSame">两次密码不一致</div>
					</div>
					</form>
				</div>
			</div>
			<div class="modal-footer">
				<button id="delete" type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				<button id="updatePassword" type="button" class="btn btn-primary">提交更改</button>
			</div>
		</div>
		<!-- /.modal-content -->
	</div>
	<!-- /.modal -->
</div>

<style type="text/css">
		.user-header ul {
			margin-top: 5px;
			margin-left: 5px;
			padding: 0;
		}
		
		.user-header ul li {
			color: rgba(255, 255, 255, 0.8);
			text-align: left;
			margin-top: 20px;
			font-size: 17px;
			list-style: none;
		}
		
		.new_pw, .old_pw, .beSure_pw {
			margin-top: 20px;
			margin-left: 25px;
		} 
		.change_pw{
			height: 180px;       
		}
		
		.old_pw {
			margin-top: 40px;
		}
		
		.new_pw div:nth-child(2) {
			font-size: 14px;
			margin-left: 20px;
			margin-top: 5px;
			color: red;
		}
		
		.beSure_pw div:nth-child(2) {
			display: none;
			font-size: 14px;
			margin-left: 20px;
			margin-top: 5px;
			color: red;
			font-size: 14px;
		}
		
		.old_pw div {
			margin-left: 25px;
		}
		
		.input-password {
			width: 90%;
		} 
		
		.input-password:nth-child(1) {
			margin-left: 10px;
		}
		
		
		.new_add {
			padding: 6px 27px;
		}
		
		.sure {
			margin-right: 15px;
		}
		
		.sure a {
			margin: 20px 10px 0 0;
		}
		
		.change_delet {
			margin: 10px 10px 0 0;
		}
		
		#delete {
			cursor: pointer;
		} 



		.close {
			margin-right: 10px;
			margin-top: 5px;
		}
		
		#modal-dialog {
			width: 420px;
		}
		
		.modal-body {
			padding: 20px 0 20px;
			width: 100%;
		}
		
		.modal-body a {
			margin-bottom: 25px;
			width: 344px;
			height: 88px;
			color: white;
			font-family: '微软雅黑';
			font-weight: bold;
			display: inline-block;
			border-radius: 4px;
			text-align: left;
			line-height: 88px;
		}
		
		.modal-body a i {
			color: white;
			font-weight: normal;
		}
		
		
		/*新增*/
		#factoryName{
			border: 1px solid #ccc;
			padding: 6px;
			width: 28%;
		}
		select{
			padding: 6px;
			width: 100px;
		}
		.special{
			border: 1px solid #ccc;
			width: 100%;  				/*更改*/
			padding: 6px;
		}
		.special:nth-child(1) {
			width: 40%;
			margin-top: 5px;
		}
		/*新增*/
</style>

<script src="AdminLTE%20_%20factory%20management%281%29_files/jquery.js" type="text/javascript"></script>

<script type="text/javascript">
	$('.masking').hide();
	$('.change_pw').hide();

	$('.change_btn').click(function() {
		$('.change_pw').show();
		$('.masking').show();
	});
	$('#delete').click(function() {
		$('.change_pw').hide();
		$('.masking').hide();
		$("#notSame").hide();
		$('#passwordform')[0].reset();
	});
	$('#close').click(function() {
		$('.change_pw').hide();
		$('.masking').hide();
		$("#notSame").hide();
		$('#passwordform')[0].reset();
	});
	$('#exit').click(function() {
		window.location.href = "http://139.224.191.23/scm/logout";
	})
	$('#newPassword1').focus(function() {
		$("#notSame").hide();
	});
	$('#newPassword2').focus(function() {
		$("#notSame").hide();
	});
	$(function() {
		//向服务端获取当前用户基本信息
		var url = "http://139.224.191.23/scm/sysuser/getUser";
		$.ajax({
			"url" : url,
			"type" : "get",
			"dataType" : "json",
			"success" : function(result) {
				if (result.head.respCode == "0000000") {
					$('#name2').html(result.body.name);
					$('#email').html("账号：" + result.body.email);
					$('#name').html("姓名：" + result.body.name);
					var roleName = "角色：";
					for (var i = 0; i < result.body.roleName.length; i++) {
						roleName += result.body.roleName[i] + "、";
					}
					roleName = roleName.substring(0, roleName.length - 1);
					$('#roleName').html(roleName);
				}
			},
		/* "error":function(result){
			if(result.head.respCode=="9999990"){
			 	alert(result.body);
			 }
		} */
		});
		//修改密码
		$('#updatePassword')
				.click(
						function() {
							if ($('#newPassword1').val() == ""
									|| $('#newPassword2').val() == ""
									|| $('#oldPassword').val() == "") {
								alert("密码不能为空");
								return;
							}
							//两次密码不一致
							if ($('#newPassword1').val() != $('#newPassword2')
									.val()) {
								$("#notSame").show();
								return;
							}
							var formData = new FormData($('#passwordform')[0]);
							url = "http://139.224.191.23/scm/sysuser/updatePassword";
							$
									.ajax({
										url : url,
										type : "post",
										data : formData,
										dataType : "json",
										async : false,
										cache : false,
										contentType : false,
										processData : false,
										success : function(result) {
											if (result.head.respCode == "0000000") {
												alert(result.body);
												if (result.body == "密码修改成功") {
													window.location.href = "http://139.224.191.23/scm/logout";
												}
												$('#passwordform')[0].reset();
											}
										},
										"error" : function(result) {
											if (result.head.respCode == "9999990") {
												alert(result.body);
												$('#passwordform')[0].reset();
											}
										}
									});
						});
	})
</script>        <div class="wrapper row-offcanvas row-offcanvas-left" style="min-height: 715px;">
            <!-- Left side column. contains the logo and sidebar -->
<aside class="left-side sidebar-offcanvas" style="min-height: 883px;">
                <!-- sidebar: style can be found in sidebar.less -->
                <section class="sidebar">
                    <!-- sidebar menu: : style can be found in sidebar.less -->
                    <ul class="sidebar-menu">
                     <li class="active">
                            <a href="http://139.224.191.23/scm/factory/index">
                                <i class="fa fa-th"></i> <span>工作台</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                                                	 <li>
                            <a href="http://139.224.191.23/scm/designorder/list">
                                <i class="fa fa-th"></i> <span>设计订单</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                        	 <li>
                            <a href="http://139.224.191.23/scm/proofingorder/list">
                                <i class="fa fa-th"></i> <span>打样订单</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                        	 <li>
                            <a href="http://139.224.191.23/scm/productionorder/list">
                                <i class="fa fa-th"></i> <span>大货订单</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                        	 <li>
                            <a href="http://139.224.191.23/scm/allOrder/list">
                                <i class="fa fa-th"></i> <span>所有订单</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                        	 <li>
                            <a href="http://139.224.191.23/scm/customer/list">
                                <i class="fa fa-th"></i> <span>客户管理</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                        	 <li>
                            <a href="http://139.224.191.23/scm/factory/list">
                                <i class="fa fa-th"></i> <span>工厂管理</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                        	 <li>
                            <a href="http://139.224.191.23/scm/designstore/list">
                                <i class="fa fa-th"></i> <span>设计库</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                        	 <li>
                            <a href="http://139.224.191.23/scm/sysuser/list">
                                <i class="fa fa-th"></i> <span>员工管理</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                        	 <li>
                            <a href="http://139.224.191.23/scm/operatelog/list">
                                <i class="fa fa-th"></i> <span>日志管理</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                        	 <li>
                            <a href="http://139.224.191.23/scm/sysrole/list">
                                <i class="fa fa-th"></i> <span>角色管理</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                    </ul>
                </section>
                <!-- /.sidebar -->
            </aside>            <!-- Right side column. Contains the navbar and content of the page -->
            <aside class="right-side">
            	<section class="content-header">
                    <h1>编辑工厂</h1>
                    <ol class="ol_left">
		                <li>当前位置：</li>
		                <li><a href="http://139.224.191.23/scm/factory/list">工厂管理</a></li>
		                <li>&gt; 编辑工厂</li>
		            </ol>
                </section>
                <!-- Main content -->
                <section class="content">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="box" style="padding: 20px;">
                                <!-- <span style="display:none;" id="factoryId">57</span> -->
                                <div class="box-title">
                                <form id="modify_factory" action="../factory/updateFactory?id=57" method="post" enctype="multipart/form-data">
                                	<table class="table table-bordered">
                                		<tbody><tr>
                                    		<td>
                                    			<span class="star">*</span>
                                    			<span>工厂编号</span>
                                    		</td>
                                    		<td colspan="5">
                                    			<span id="factoryCode">20161129356027</span>
                                    		</td>
                                    	</tr>
                                    	<tr>
                                    		<td>
                                    			<span class="star">*</span>
                                    			<span>工厂名称</span>
                                    		</td>
                                    		<td colspan="5">
                                    			<input id="factoryName" name="factoryName" placeholder="请输入工厂名称" value="新建测试工厂" type="text">
                                    		</td>
                                    	</tr>
                                    	<tr>
                                    		<td>
                                    			<span class="star">*</span>
                                    			<span>工厂地址</span>
                                    		</td>
                                    		<td colspan="5">
                                    			<div style="overflow: hidden;">
													<div style="float: left; margin-right: 5px;">
														<select id="province" name="provinceId">
														<option value="0">请选择</option><option value="2">北京</option><option value="3">安徽</option><option value="4">福建</option><option value="5">甘肃</option><option value="6">广东</option><option value="7">广西</option><option value="8">贵州</option><option value="9">海南</option><option value="10">河北</option><option selected="selected" value="11">河南</option><option value="12">黑龙江</option><option value="13">湖北</option><option value="14">湖南</option><option value="15">吉林</option><option value="16">江苏</option><option value="17">江西</option><option value="18">辽宁</option><option value="19">内蒙古</option><option value="20">宁夏</option><option value="21">青海</option><option value="22">山东</option><option value="23">山西</option><option value="24">陕西</option><option value="25">上海</option><option value="26">四川</option><option value="27">天津</option><option value="28">西藏</option><option value="29">新疆</option><option value="30">云南</option><option value="31">浙江</option><option value="32">重庆</option><option value="33">香港</option><option value="34">澳门</option><option value="35">台湾</option></select>
													</div>
													<div style="float: left; margin-right: 5px;">
														<select id="city" name="cityId"><option value="0">请选择</option><option value="149">郑州</option><option value="150">洛阳</option><option value="151">开封</option><option value="152">安阳</option><option value="153">鹤壁</option><option value="154">济源</option><option value="155">焦作</option><option selected="selected" value="156">南阳</option><option value="157">平顶山</option><option value="158">三门峡</option><option value="159">商丘</option><option value="160">新乡</option><option value="161">信阳</option><option value="162">许昌</option><option value="163">周口</option><option value="164">驻马店</option><option value="165">漯河</option><option value="166">濮阳</option></select>
													</div>
													<div style="float: left;">
														<select id="area" name="areaId"><option value="0">请选择</option><option value="1318">卧龙区</option><option value="1319">宛城区</option><option value="1320">邓州市</option><option value="1321">南召县</option><option value="1322">方城县</option><option value="1323">西峡县</option><option value="1324">镇平县</option><option selected="selected" value="1325">内乡县</option><option value="1326">淅川县</option><option value="1327">社旗县</option><option value="1328">唐河县</option><option value="1329">新野县</option><option value="1330">桐柏县</option></select>
													</div>
												</div>
												<div>
													<input id="detailAddress" name="detailAddress" class="address special" placeholder="填写详细地址" value="吉祥街道" type="text">
												</div>
                                    		</td>
                                    	</tr>
                                    	<tr>
                                    		<td>
                                    			<span class="star">*</span>
                                    			<span>联系人</span>
                                    		</td>
                                    		<td>
                                    			<input id="linkman" name="linkman" class="special" value="小胡" type="text">
                                    		</td>
                                    		<td>
                                    			<span class="star">*</span>
                                    			<span>联系电话</span>
                                    		</td>
                                    		<td colspan="3">
                                    			<input id="contact" name="contact" class="special" value="11334453654" type="text">
                                    		</td>
                                    	</tr>
                                    	<tr>
                                    		<td>
                                    			<span class="star">*</span>
                                    			<span>工厂人数</span>
                                    		</td>
                                    		<td colspan="5">
                                    			<div id="personAmount" class="style"><label class=""><div class="iradio_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="personAmount" value="50人以下" style="position: absolute; opacity: 0;" type="radio"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>50人以下</label><label class="hover"><div class="iradio_minimal checked hover" style="position: relative;" aria-checked="false" aria-disabled="false"><input checked="checked" name="personAmount" value="50~100人" style="position: absolute; opacity: 0;" type="radio"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>50~100人</label><label class=""><div class="iradio_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="personAmount" value="100~200人" style="position: absolute; opacity: 0;" type="radio"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>100~200人</label><label class=""><div class="iradio_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="personAmount" value="200人以上" style="position: absolute; opacity: 0;" type="radio"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>200人以上</label></div>
                                    		</td>
                                    	</tr>
                                    	<tr>
                                    		<td>
                                    			<span class="star">*</span>
                                    			<span>梭织类型</span>
                                    		</td>
                                    		<td colspan="5">
                                    			<div id="tattingStyle" class="style" style="margin-bottom: 15px;"><label><div class="icheckbox_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="tattingStyleIds" value="1" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>羽绒服</label><label class=""><div class="icheckbox_minimal checked" style="position: relative;" aria-checked="false" aria-disabled="false"><input checked="checked" name="tattingStyleIds" value="2" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>夹克</label><label class=""><div class="icheckbox_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="tattingStyleIds" value="3" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>外套</label><label><div class="icheckbox_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="tattingStyleIds" value="4" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>呢大衣</label><label><div class="icheckbox_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="tattingStyleIds" value="5" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>连衣裙</label><label><div class="icheckbox_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="tattingStyleIds" value="6" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>短裙</label><label><div class="icheckbox_minimal checked" style="position: relative;" aria-checked="false" aria-disabled="false"><input checked="checked" name="tattingStyleIds" value="7" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>裤子</label><label class=""><div class="icheckbox_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="tattingStyleIds" value="8" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>衬衣</label><label class=""><div class="icheckbox_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="tattingStyleIds" value="9" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>登山服</label><label class=""><div class="icheckbox_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="tattingStyleIds" value="10" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>防水服</label><label><div class="icheckbox_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="tattingStyleIds" value="59" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>西服</label><label><div class="icheckbox_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="tattingStyleIds" value="60" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>背心</label></div>
                                    		</td>
                                    		
                                    		
                                    		
                                    		
                                    	</tr>
                                    	<tr>
                                    		<td>
                                    			<span class="star">*</span>
                                    			<span>针织类型</span>
                                    		</td>
                                    		<td colspan="5">
                                    			<div id="wovenStyle" class="style" style="margin-bottom: 15px;"><label class=""><div class="icheckbox_minimal checked" style="position: relative;" aria-checked="false" aria-disabled="false"><input checked="checked" name="wovenStyleIds" value="15" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>外套</label><label class=""><div class="icheckbox_minimal checked" style="position: relative;" aria-checked="false" aria-disabled="false"><input checked="checked" name="wovenStyleIds" value="16" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>裤子</label><label class=""><div class="icheckbox_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="wovenStyleIds" value="17" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>睡衣</label><label><div class="icheckbox_minimal checked" style="position: relative;" aria-checked="false" aria-disabled="false"><input checked="checked" name="wovenStyleIds" value="18" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>T恤</label><label><div class="icheckbox_minimal checked" style="position: relative;" aria-checked="false" aria-disabled="false"><input checked="checked" name="wovenStyleIds" value="19" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>Polo衫</label><label><div class="icheckbox_minimal checked" style="position: relative;" aria-checked="false" aria-disabled="false"><input checked="checked" name="wovenStyleIds" value="20" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>连衣裙</label><label class=""><div class="icheckbox_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="wovenStyleIds" value="21" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>短裙</label><label class=""><div class="icheckbox_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="wovenStyleIds" value="61" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>西服</label></div>
                                    		</td>
                                    	</tr>
                                    	<tr>
                                    		<td>
                                    			<span class="star">*</span>
                                    			<span>毛衣类型</span>
                                    		</td>
                                    		<td colspan="5">
                                    			<div id="sweaterStyle" class="style" style="margin-bottom: 15px;"><label class=""><div class="icheckbox_minimal checked" style="position: relative;" aria-checked="false" aria-disabled="false"><input checked="checked" name="sweaterStyleIds" value="22" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>外套</label><label class=""><div class="icheckbox_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="sweaterStyleIds" value="23" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>开衫</label><label class=""><div class="icheckbox_minimal checked" style="position: relative;" aria-checked="false" aria-disabled="false"><input checked="checked" name="sweaterStyleIds" value="24" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>圆领</label><label><div class="icheckbox_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="sweaterStyleIds" value="25" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>V领</label><label><div class="icheckbox_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="sweaterStyleIds" value="26" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>连衣裙</label><label><div class="icheckbox_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="sweaterStyleIds" value="27" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>短裙</label><label class=""><div class="icheckbox_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="sweaterStyleIds" value="62" style="position: absolute; opacity: 0;" type="checkbox"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>背心</label></div>
                                    		</td>
                                    	</tr>
                                    	<tr>
                                    		<td>
                                    			<span class="star">*</span>
                                    			<span>销往目的地</span>
                                    		</td>
                                    		<td id="saleTarget" colspan="5"><label class=""><div class="iradio_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="saleTarget" value="内销" style="position: absolute; opacity: 0;" type="radio"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>内销</label><label class=""><div class="iradio_minimal checked" style="position: relative;" aria-checked="false" aria-disabled="false"><input checked="checked" name="saleTarget" value="外销" style="position: absolute; opacity: 0;" type="radio"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>外销</label></td>
                                    	</tr>
                                    	<tr>
                                    		<td>
                                    			<span class="star">*</span>
                                    			<span>合作条件</span>
                                    		</td>
                                    		<td colspan="5">
                                    			<div id="cooperationCondition" class="style"><label class=""><div class="iradio_minimal checked" style="position: relative;" aria-checked="false" aria-disabled="false"><input checked="checked" name="cooperationCondition" value="20件以下" style="position: absolute; opacity: 0;" type="radio"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>20件以下</label><label class=""><div class="iradio_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="cooperationCondition" value="20~50件" style="position: absolute; opacity: 0;" type="radio"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>20~50件</label><label><div class="iradio_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="cooperationCondition" value="50~100件" style="position: absolute; opacity: 0;" type="radio"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>50~100件</label><label><div class="iradio_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="cooperationCondition" value="100~300件" style="position: absolute; opacity: 0;" type="radio"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>100~300件</label><label><div class="iradio_minimal" style="position: relative;" aria-checked="false" aria-disabled="false"><input name="cooperationCondition" value="300件以上" style="position: absolute; opacity: 0;" type="radio"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins></div>300件以上</label></div>
                                    		</td>
                                    	</tr>
                                    	<tr>
                                    		<td>
                                    			<span class="star">*</span>
                                    			<span>工厂评估</span>
                                    		</td>
                                    		<td colspan="5">
                                    			<div id="estimateReport">
                                    				<!-- <span>新建文件.txt</span>
                                    				<input id="estimateReport" name="estimateReport" type="file" /> -->
                                    			<span>1480407609271新建文本文档.txt</span><a href="http://139.224.191.23/scm/factory/downloadReport?fileName=1480407609271%E6%96%B0%E5%BB%BA%E6%96%87%E6%9C%AC%E6%96%87%E6%A1%A3.txt">下载评估报告 </a><input name="estimateReport" type="file"></div>
                                    		</td>
                                    	</tr>
                                   </tbody></table>
                                   </form>
                                   	<div style="margin-bottom: 50px;">
				                		<button id="modify" type="button" class="btn btn-primary">确定修改</button>
					                	<button id="cancel" type="button" class="btn btn-default">放弃修改</button>
					                </div>
                                </div>
                                
                                
                                <!--<div class="box-footer clearfix">
                                    <ul class="pagination pagination-sm no-margin pull-right">
                                        <li><a href="#">&laquo;</a></li>
                                        <li><a href="#">1</a></li>
                                        <li><a href="#">2</a></li>
                                        <li><a href="#">3</a></li>
                                        <li><a href="#">&raquo;</a></li>
                                    </ul>
                                </div>-->
                                
                            </div><!-- /.box -->

                            
                        </div><!-- /.col -->
                        
                    </div><!-- /.row -->
                    
                </section><!-- /.content -->
                
            </aside><!-- /.right-side -->
        </div><!-- ./wrapper -->


        <!-- jQuery 2.0.2 -->
        <script src="AdminLTE%20_%20factory%20management%281%29_files/jquery.js"></script>
        <!-- jQuery UI 1.10.3 -->
        <script src="AdminLTE%20_%20factory%20management%281%29_files/jquery-ui-1.js" type="text/javascript"></script>
        
        
        <script type="text/javascript">
        $(function(){
        	//展示工厂详细信息
        	showFactoryDetail();
        	$('#province').change(provinceOnSelect);
        	$('#city').change(cityOnSelect);
        	//新建按钮点击事件
        	$('#modify').click(modifyFactory);
        	$('#cancel').click(function(){
        		alert("放弃修改，编辑数据将不进行保存");
        		window.location.href="../factory/list";
        	});
        });

        //展示工厂详细信息
        function showFactoryDetail(){
        	var factoryId = $('#factoryId').text();
        	var url = "../factory/detail";
        	var data = {"factoryId":57};
        	//关闭ajax异步
        	$.ajaxSettings.async = false;
        	$.getJSON(url,data,function(result){
        		if(result.head.respCode=="0000000"){
        			//查询到的指定Id的工厂详情
        			var factory = result.body;
        			$('#factoryCode').text(factory.code);
        			$('#factoryName').val(factory.name);
        			//获取所有省数据
                	getAllProvince(factory.province_id);
        			//获取对应市的所有数据
        			getCityByParentId(factory.province_id,factory.city_id);
        			//获取对应县或区的所有数据
        			getAreaByParentId(factory.city_id,factory.area_id);
        			/* var option = $('<option value="'+factory.province_id+'">'+factory.province+'</option>');
        			$('#province').append(option);
        			option = $('<option value="'+factory.city_id+'">'+factory.city+'</option>');
        			$('#city').append(option);
        			option = $('<option value="'+factory.area_id+'">'+factory.area+'</option>');
        			$('#area').append(option); */
        			$('#detailAddress').val(factory.detail_address);
        			$('#linkman').val(factory.factoryContacts[0].linkman);
        			$('#contact').val(factory.factoryContacts[0].contact);
        			//获取工厂人数列表
        			getPersonAmount(factory.person_amount);
        			//获取梳织类型列表
        			getTattingStyle(factory.tattingStyle);
        			//获取针织类型列表
        			getWovenStyle(factory.wovenStyle);
        			//获取毛衣类型列表
        			getSweaterStyle(factory.sweaterStyle);
        			//获取销往目的地列表
        			getSaleTarget(factory.sale_target);
        			//获取销往目的地列表
        			getCooperationCondition(factory.cooperation_condition);
        			if(factory.estimate_report!=null&&factory.estimate_report!=""){
        				$('#estimateReport').append('<span>'+factory.estimate_report+'</span>'
        				                    		+'<a href="downloadReport?fileName='+factory.estimate_report+'">下载评估报告 </a>'
                    								+'<input type="file" name="estimateReport" name="file">');
        			}else{
        				$('#estimateReport').append('<input type="file" name="estimateReport" name="file">');
        			}
        		}
        	});
        	//开启ajax异步
        	$.ajaxSettings.async = true;
        }

        //获取所有省数据
        function getAllProvince(provinceId){
        	var url = "../area/province";
        	$.getJSON(url,function(result){
        		if(result.head.respCode=="0000000"){
        			var provinces = result.body.rows;
        			var view = $('#province');
        			//view.empty();
        			var option = $('<option value="0">请选择</option>');
        			view.append(option)
        			for(var i=0;i<provinces.length;i++){
        				if(provinceId!=null&&provinces[i].areaId==provinceId){
        					var option = $('<option selected="selected" value="'+provinces[i].areaId+'">'+provinces[i].areaName+'</option>');
        				}else{
        					var option = $('<option value="'+provinces[i].areaId+'">'+provinces[i].areaName+'</option>');
        				}
        				
        				view.append(option);
        			}
        		}
        	});
        }

        //从服务端根据parentId获取对应的市列表
        function getCityByParentId(parentId,cityId){
        	var url = "../area/cityOrArea";
        	var data = {"parentId":parentId};
        	$.getJSON(url,data,function(result){
        		if(result.head.respCode=="0000000"){
        			var citys = result.body.rows;
        			var view = $('#city');
        			view.empty();
        			var option = $('<option value="0">请选择</option>');
        			view.append(option)
        			for(var i=0;i<citys.length;i++){
        				if(cityId!=null&&citys[i].areaId==cityId){
        					var option = $('<option selected="selected" value="'+citys[i].areaId+'">'+citys[i].areaName+'</option>');
        				}else{
        					var option = $('<option value="'+citys[i].areaId+'">'+citys[i].areaName+'</option>');
        				}
        				view.append(option);
        			}
        		}
        	});
        }

        //从服务端根据parentId获取对应的区县列表
        function getAreaByParentId(parentId,areaId){
        	var url = "../area/cityOrArea";
        	var data = {"parentId":parentId};
        	$.getJSON(url,data,function(result){
        		if(result.head.respCode=="0000000"){
        			var areas = result.body.rows;
        			var view = $('#area');
        			view.empty();
        			var option = $('<option value="0">请选择</option>');
        			view.append(option)
        			for(var i=0;i<areas.length;i++){
        				if(areaId!=null&&areas[i].areaId==areaId){
        					var option = $('<option selected="selected" value="'+areas[i].areaId+'">'+areas[i].areaName+'</option>');
        				}else{
        					var option = $('<option value="'+areas[i].areaId+'">'+areas[i].areaName+'</option>');
        				}
        				view.append(option);
        			}
        		}
        	});
        }

        //省下拉框选中监听事件
        function provinceOnSelect(){
        	if($(this).val()!="0"){
        		//console.log($(this).val());
        		//省选中后清空所有
        		cleanArea();
        		var provinceId = $(this).val();
        		//从服务端获取对应的城市列表
        		getCityByParentId(provinceId,null);
        	}
        	if($(this).val()=="0"){
        		cleanCity();
        		cleanArea();
        	}
        }

        //市下拉框选中监听事件
        function cityOnSelect(){
        	if($(this).val()!="0"){
        		var cityId = $(this).val();
        		//从服务端获取对应的区县列表
        		getAreaByParentId(cityId,null);
        	}
        	if($(this).val()=="0"){
        		cleanArea();
        	}
        }


        //清空市
        function cleanCity(){
        	var view = $('#city');
        	view.empty();
        	var option = $('<option value="0">请选择</option>');
        	view.append(option);
        }

        //清空区县
        function cleanArea(){
        	var view = $('#area');
        	view.empty();
        	var option = $('<option value="0">请选择</option>');
        	view.append(option);
        }

        //获取工厂人数列表
        function getPersonAmount(personAmount){
        	var constants = getConstant("scm_factory-person_amount");
        	var view = $('#personAmount');
        	view.empty();
        	for(var i=0;i<constants.length;i++){
        		if(personAmount==constants[i].name){
        			var label = $('<label><input type="radio" checked="checked" name="personAmount" value="'+constants[i].name+'"  />'+constants[i].name+'</label>')
        		}else{
        			var label = $('<label><input type="radio" name="personAmount" value="'+constants[i].name+'"  />'+constants[i].name+'</label>')
        		}
        		view.append(label);
        	}
        }

        //获取梳织类型列表
        function getTattingStyle(tattingStyle){
        	var constants = getConstant("scm_factory-tatting_style");
        	var view = $('#tattingStyle');
        	view.empty();
        	for(var i=0;i<constants.length;i++){
        		var label = $('<label><input type="checkbox" name="tattingStyleIds" value="'+constants[i].id+'"  />'+constants[i].name+'</label>')
        		for(var j=0;j<tattingStyle.length;j++){
        			if(tattingStyle[j].id==constants[i].id){
        				label = $('<label><input type="checkbox" checked="checked" name="tattingStyleIds" value="'+constants[i].id+'"  />'+constants[i].name+'</label>')
        			}
        		}
        		view.append(label);
        	}
        }

        //获取针织类型列表
        function getWovenStyle(wovenStyle){
        	var constants = getConstant("scm_factory-woven_style");
        	var view = $('#wovenStyle');
        	view.empty();
        	for(var i=0;i<constants.length;i++){
        		var label = $('<label><input type="checkbox" name="wovenStyleIds" value="'+constants[i].id+'"  />'+constants[i].name+'</label>')
        		for(var j=0;j<wovenStyle.length;j++){
        			if(wovenStyle[j].id==constants[i].id){
        				label = $('<label><input type="checkbox" checked="checked" name="wovenStyleIds" value="'+constants[i].id+'"  />'+constants[i].name+'</label>')
        			}
        		}
        		view.append(label);
        	}
        }

        //获取毛衣类型列表
        function getSweaterStyle(sweaterStyle){
        	var constants = getConstant("scm_factory-sweater_style");
        	var view = $('#sweaterStyle');
        	view.empty();
        	for(var i=0;i<constants.length;i++){
        		var label = $('<label><input type="checkbox" name="sweaterStyleIds" value="'+constants[i].id+'"  />'+constants[i].name+'</label>')
        		for(var j=0;j<sweaterStyle.length;j++){
        			if(sweaterStyle[j].id==constants[i].id){
        				label = $('<label><input type="checkbox" checked="checked" name="sweaterStyleIds" value="'+constants[i].id+'"  />'+constants[i].name+'</label>')
        			}
        		}
        		view.append(label);
        	}
        }

        //获取销往目的地列表
        function getSaleTarget(saleTarget){
        	var constants = getConstant("scm_factory-sale_target");
        	var view = $('#saleTarget');
        	view.empty();
        	for(var i=0;i<constants.length;i++){
        		if(saleTarget==constants[i].name){
        			var label = $('<label><input type="radio" checked="checked" name="saleTarget" value="'+constants[i].name+'"  />'+constants[i].name+'</label>');
        		}else{
        			var label = $('<label><input type="radio" name="saleTarget" value="'+constants[i].name+'"  />'+constants[i].name+'</label>');
        		}
        		view.append(label);
        	}
        }

        //获取合作条件
        function getCooperationCondition(cooperationCondition){
        	var constants = getConstant("scm_factory-cooperation_condition");
        	var view = $('#cooperationCondition');
        	view.empty();
        	for(var i=0;i<constants.length;i++){
        		if(cooperationCondition==constants[i].name){
        			var label = $('<label><input type="radio" checked="checked" name="cooperationCondition" value="'+constants[i].name+'"  />'+constants[i].name+'</label>')
        		}else{
        			var label = $('<label><input type="radio" name="cooperationCondition" value="'+constants[i].name+'"  />'+constants[i].name+'</label>')
        		}
        		view.append(label);
        	}
        }

        //根据分类条件查询所有的常量列表
        function getConstant(category){
        	var constants={};
        	var url = "../constant/getConstantByCategory";
        	var data = {"category":category};
        	//关闭ajax异步
        	$.ajaxSettings.async = false;
        	$.getJSON(url,data,function(result){
        		if(result.head.respCode="0000000"){
        			constants = result.body.rows;
        		}
        	});
        	//开启ajax异步
        	$.ajaxSettings.async = true;
        	return constants;
        }

        //新增工厂
        function modifyFactory(){
        	var formData = new FormData($("#modify_factory")[0]);  
            $.ajax({  
                 url: '../factory/updateFactory?id=57' ,  
                 type: 'POST',  
                 data: formData,  
                 async: false,  
                 cache: false,  
                 contentType: false,  
                 processData: false,  
                 success: function (result) {
                	 if(result.head.respCode=="0000000"){
                		 alert(result.body);
                		 if(result.body=="修改成功"){
                		 	window.location.href="../factory/showDetailPage?factoryId=57";
                		 }
                	 }
                	 if(result.head.respCode=="9999990"){
                		 alert(result.body);
                	 }
                 }
            });
        }

        </script>
        
        <!-- Bootstrap -->
        <script src="AdminLTE%20_%20factory%20management%281%29_files/bootstrap.js" type="text/javascript"></script>
        <!-- AdminLTE App -->
        <script src="AdminLTE%20_%20factory%20management%281%29_files/app.js" type="text/javascript"></script>

    

<script src="AdminLTE%20_%20factory%20management%281%29_files/t.js" charset="utf-8"></script></body></html>